Optimal. Leaf size=52 \[ (A b+a B) x+\frac {(b B+a C) \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a A \sin (c+d x)}{d}+\frac {b C \tan (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 52, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 37, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.135, Rules used = {4161, 4132, 8,
4130, 3855} \begin {gather*} x (a B+A b)+\frac {a A \sin (c+d x)}{d}+\frac {(a C+b B) \tanh ^{-1}(\sin (c+d x))}{d}+\frac {b C \tan (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3855
Rule 4130
Rule 4132
Rule 4161
Rubi steps
\begin {align*} \int \cos (c+d x) (a+b \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\frac {b C \tan (c+d x)}{d}+\int \cos (c+d x) \left (a A+(A b+a B) \sec (c+d x)+(b B+a C) \sec ^2(c+d x)\right ) \, dx\\ &=\frac {b C \tan (c+d x)}{d}+(A b+a B) \int 1 \, dx+\int \cos (c+d x) \left (a A+(b B+a C) \sec ^2(c+d x)\right ) \, dx\\ &=(A b+a B) x+\frac {a A \sin (c+d x)}{d}+\frac {b C \tan (c+d x)}{d}+(b B+a C) \int \sec (c+d x) \, dx\\ &=(A b+a B) x+\frac {(b B+a C) \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a A \sin (c+d x)}{d}+\frac {b C \tan (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.03, size = 71, normalized size = 1.37 \begin {gather*} A b x+a B x+\frac {b B \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a C \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a A \cos (d x) \sin (c)}{d}+\frac {a A \cos (c) \sin (d x)}{d}+\frac {b C \tan (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.08, size = 74, normalized size = 1.42
method | result | size |
derivativedivides | \(\frac {A b \left (d x +c \right )+b B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+C b \tan \left (d x +c \right )+A \sin \left (d x +c \right ) a +B a \left (d x +c \right )+a C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) | \(74\) |
default | \(\frac {A b \left (d x +c \right )+b B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+C b \tan \left (d x +c \right )+A \sin \left (d x +c \right ) a +B a \left (d x +c \right )+a C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) | \(74\) |
risch | \(A b x +a B x -\frac {i a A \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i a A \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {2 i C b}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) b B}{d}+\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) b B}{d}-\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{d}\) | \(143\) |
norman | \(\frac {\left (A b +B a \right ) x +\left (-A b -B a \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-A b -B a \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (A b +B a \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {2 \left (a A -C b \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {2 \left (a A +C b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {4 a A \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}+\frac {\left (b B +a C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {\left (b B +a C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) | \(217\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 92, normalized size = 1.77 \begin {gather*} \frac {2 \, {\left (d x + c\right )} B a + 2 \, {\left (d x + c\right )} A b + C a {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + B b {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 2 \, A a \sin \left (d x + c\right ) + 2 \, C b \tan \left (d x + c\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.10, size = 101, normalized size = 1.94 \begin {gather*} \frac {2 \, {\left (B a + A b\right )} d x \cos \left (d x + c\right ) + {\left (C a + B b\right )} \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (C a + B b\right )} \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (A a \cos \left (d x + c\right ) + C b\right )} \sin \left (d x + c\right )}{2 \, d \cos \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sec {\left (c + d x \right )}\right ) \left (A + B \sec {\left (c + d x \right )} + C \sec ^{2}{\left (c + d x \right )}\right ) \cos {\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 134 vs.
\(2 (52) = 104\).
time = 0.49, size = 134, normalized size = 2.58 \begin {gather*} \frac {{\left (B a + A b\right )} {\left (d x + c\right )} + {\left (C a + B b\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (C a + B b\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 1}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.26, size = 153, normalized size = 2.94 \begin {gather*} \frac {C\,b\,\mathrm {tan}\left (c+d\,x\right )}{d}+\frac {2\,A\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,B\,a\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,B\,b\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,C\,a\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {A\,a\,\sin \left (2\,c+2\,d\,x\right )}{2\,d\,\cos \left (c+d\,x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________